<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>文章列表</title>

  {include file='common/_require'/}
</head>

<body>
  {include file='common/_header'/}
  {include file='common/_index_header'/}
  <script>$('.index-post-nav-{$Request.param.category_id}').addClass('layui-this')</script>
  <div class="layui-container">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md8">
        <div class="fly-panel" style="margin-bottom: 0;">

          <div class="fly-panel-title fly-filter">
            <a href="{:url('Post/index', array_merge($Request.get,['is_good'=>0]) )}" class="item-is-good-0">综合</a>
            <span class="fly-mid"></span>
            <a href="{:url('Post/index', array_merge($Request.get,['is_good'=>1]) )}" class="item-is-good-1">精华</a>
            <span class="fly-filter-right layui-hide-xs">
              <a href="{:url('Post/index', array_merge($Request.get,['sort_by'=>'create_time']) )}" class="item-sort-by-create_time">按最新</a>
              <span class="fly-mid"></span>
              <a href="{:url('Post/index', array_merge($Request.get,['sort_by'=>'comment']) )}" class="item-sort-by-comment">按热议</a>
            </span>

            <script>

              $('.item-is-good-{$Request.param.is_good|default="0"}').addClass('layui-this')
              $('.item-sort-by-{$Request.param.sort_by|default="create_time"}').addClass('layui-this')

            </script>

          </div>

          <ul class="fly-list">
            {volist name='list_index_post' id='post'}

            <li>
              <a href="{$post.user.index_url}" class="fly-avatar">
                <img src="{$post.user.avatar_src}" alt="{$post.user.nickname}">
              </a>
              <h2>
                <a class="layui-badge">{$post.category.title}</a>
                <a href="{:url('Post/read',['id'=>$post.id])}">{$post.title}</a>
              </h2>
              <div class="fly-list-info">
                <a href="{$post.user.index_url}" link>
                  <cite>{$post.user.nickname}</cite>
                  {eq name='$post.user.auth_status' value='1'}
                  <i class="iconfont icon-renzheng" title="{$post.user.auth_content}"></i>
                  {/eq}
                  <i class="layui-badge fly-badge-vip">{$user.vip.title|default="VIP0"}</i>

                </a>
                <span>{$post.publish_time_tran}</span>

                <!-- <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i> 60</span> -->
                <!--<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>-->
                <span class="fly-list-nums">
                  <i class="iconfont icon-pinglun1" title="回答"></i> {$post.comment}
                </span>
              </div>
              <div class="fly-list-badge">
                {eq name='$post.is_good' value='1'}
                <span class="layui-badge layui-bg-red">精帖</span>
                {/eq}
              </div>
            </li>
            {/volist}

          </ul>
          {empty name='list_index_post'}
          <div class="fly-none">没有相关数据</div>
          {/empty}

          <div style="text-align: center">
            {$list_index_post->render()|raw}
          </div>

        </div>
      </div>
      <div class="layui-col-md4">
        <dl class="fly-panel fly-list-one">
          <dt class="fly-panel-title">本周热议</dt>
          {volist name='list_comments_posts' id='vo'}
          <dd>
            <a href="{$vo.post.read_url}">{$vo.post.title}</a>
            <span><i class="iconfont icon-pinglun1"></i> {$vo.count}</span>
          </dd>

          {/volist}
          {empty name='list_comments_posts'}

          <div class="fly-none">没有相关数据</div>

          {/empty}

          <!-- 无数据时 -->
          <!--
        -->
        </dl>
        {notempty name='\app\model\Nav::getListIndexNav("post_index_ad")'}
        <div class="fly-panel">
          <div class="fly-panel-title">
            赞助广告
          </div>
          <div class="fly-panel-main">
            {volist name='\app\model\Nav::getListIndexNav("post_index_ad")' id='nav'}
            {empty name='$nav->getData("img")'}
            <a href="{$nav.value}" target="{$nav.target}" class="fly-zanzhu" style="background-color: #66CCFF ;">{$nav.title}</a>
            {else /}
            <a href="{$nav.value}" target="{$nav.target}" class="fly-zanzhu" style="background-image: url('{$nav.img}');background-size: cover;background-position: center;">{$nav.title}</a>
            {/empty}
            {/volist}
          </div>
        </div>
        {/notempty}

        <div class="fly-panel fly-link">
          <h3 class="fly-panel-title">友情链接</h3>
          <dl class="fly-panel-main">
            {volist name='\app\model\Nav::getListIndexNav("friend_link")' id='nav'}
            <dd>
              <a href="{$nav.value}" target="{$nav.target}">{$nav.title}</a>
            </dd>
            {/volist}
          </dl>
        </div>

      </div>
    </div>
  </div>
  {include file='common/_footer'/}
  <script>

  </script>

</body>

</html>